<?php

abstract class WebAjax extends AuthorizeWebController {
    
    protected $contextPath;
    protected $language;
    protected $cache;
    protected $orm_builder;
    
    public function doAction(HttpRequest $request,HttpResponse $response){
        $this->contextPath = APPLICATION_URL."/".$request->get("_LANGUAGE",DEFAULT_LANGUAGE);
        $this->language = $request->get("_LANGUAGE",DEFAULT_LANGUAGE);
        $this->cache = array();
        $this->orm_builder = new ORMBuilder(RENZA_DBMS);
        if($this->isAuthorize($request)){
            echo json_encode($this->processRequest($request->get("_ACTION",DEFAULT_CONTROLLER_ACTION),$request,$response));
        }
    }
    
    protected abstract function processRequest($action_type,HttpRequest $request,HttpResponse $response);
    
}
